package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.MiniSelfSelection;
import com.ruoyi.system.domain.vo.h5.SelfSelectionListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
    * @author ld
    * @description 针对表【mini_self_selection(自选表)】的数据库操作Mapper
    * @createDate 2023-11-19 17:39:49
    * @Entity com.ruoyi.system.domain.MiniSelfSelection
    */
public interface MiniSelfSelectionMapper extends BaseMapper<MiniSelfSelection> {

    /**
     * 查自选的股票
     * @param type
     * @param openid
     * @return
     */
    List<SelfSelectionListVO> selectSelfSelectionWithStock(@Param("type") String type, @Param("openid") String openid);

    /**
     * 查自选的题材
     * @param type
     * @param openid
     * @return
     */
    List<SelfSelectionListVO> selectSelfSelectionWithSubject(@Param("type") String type, @Param("openid") String openid);
    /**
     * 以openid查询自选数量
     * @param openid
     * @return
     */
    List<MiniSelfSelection> selectSelfSelectionCountByOpenid(String openid);

    /**
     * 检查是否添加到自选了
     *
     * @param type
     * @param id
     * @param stockNo
     * @return
     */
    Integer checkSelfSelection(@Param("type")  String type, @Param("openid") String openid, @Param("id") Long id, @Param("stockNo") String stockNo);
}